<!DOCTYPE html>
<html>
<head>
	<title>Sorted Header</title>
	<link rel="stylesheet" href="../../codebase/webix/webix.css" type="text/css" charset="utf-8">
	<script src="../../codebase/webix/webix.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../../codebase//pivot.css" type="text/css" charset="utf-8">
	<script src="../../codebase/pivot.js" type="text/javascript" charset="utf-8"></script>

	<link rel="stylesheet" href="../common/samples.css" type="text/css" charset="utf-8">
</head>
<body>
<div class='header_comment'>Sorted Header</div>
<div id="testA"></div>

<style type="text/css">
	html, body {
		width: 100%;
		height: 100%;
		padding: 0;
		margin: 0;
	}
</style>

<script type="text/javascript" charset="utf-8">

	webix.ready(function(){
		grida = webix.ui({
			container:"testA",
			id:"pivot",
			view:"pivot",
			height:350,
			width:1000,
			url:"../common/data.json",
			max: true,
			structure:{
				columnSort: {
					// "year" columns
					"year": {
						dir: "desc"
					},
					//for the operation columns
					"$last": {
						as: function(a,b){
							var order = ["min", "max", "count", "sum"];
							var sep = $$("pivot").$separator;
							a = a.split(sep)[0];
							b = b.split(sep)[0];
							return order.indexOf(a) - order.indexOf(b);
						}
					}
				},
				rows: ["continent"],
				columns: ["year"],
				values: [{name:"balance", operation:["min","max"]}]
			}
		});

	});
</script>
</body>
</html>